/** 
 * Copyright: Copyright (c)2011
 * Company: 易宝支付(YeePay) 
 */
package net.loyintean.pearlshell.validation.rule;

import net.loyintean.pearlshell.validation.IValidRuleConfig;

/**
 * 校验String是否是Long数据格式
 * 
 * @author：jun.lin@yeepay.com
 * @since：2014年12月5日 下午3:02:34
 * @version:
 */
class StringIsLongValidRuleImpl extends StringIsIntValidRuleImpl {

	StringIsLongValidRuleImpl() {
		super();
	}

	/**
	 * @see net.loyintean.pearlshell.validation.rule.
	 *      StringIsIntValidRuleImpl#validString(String, IValidRuleConfig)
	 */
	@Override
	protected boolean validString(String toValid, IValidRuleConfig config) {
		try {
			Long.valueOf(toValid);
		} catch (NumberFormatException e) {
			return false;
		}
		return true;
	}

}
